<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>1920. 基于排列构建数组</title>
</head>

<body>

</body>

<script>
    /**
     * @param {number[]} nums
     * @return {number[]}
     */
    var buildArray = function (nums) {
        let ans = [];
        for (let i = 0; i < nums.length; i++) {
            let num = nums[nums[i]];
            ans.push(num);
        };
        return ans;
    };
</script>

</html>